<?php include "header.php"; ?>
<div class="container">
<div id="content"> <!-- Content start -->
                <div id="top_navigation"> <!-- Main navigation start -->
                    <ul>
                        <li><a href="index.php"><i class="icon-calendar"></i> Calender</a></li>
                        <li><a href="appointees.php"><i class="icon-user"></i> Appointees</a></li>
                        <li class="active"><a href="apppointment-types.php"><i class="icon-th-large"></i> Appointment types</a></li>
                        <li><a href="profile.php"><i class="icon-wrench"></i> Profile</a></li>
                        <li><a href="report.php"><i class="icon-paste"></i> Reports</a></li>
                    </ul>                   
                </div>  

                
            </div>
<h2>Appointment Types</h2>
<h4>Add or delete appointment types of your interest</h4>
<hr>

<div class="row-fluid">
<div class="span4 well green">
	<div class="well-header">
	<h5><strong>Add new appointment type</strong></h5>
	</div>
	<div class="well-content">
	<form action="execute/add_a_type.php" method="post">
		<p>Appointment Name</p>
		<p><input type="text" class="span12" name="a_name" placeholder="e.g. Friendly, business, work, etc."/></p>
		<p>Price</p>
		<p><input type="text" class="span12" name="a_price" placeholder="e.g. 200 AFA"/></p>
		<p>Duration (minutes)</p>
		<p><input type="text" class="span12" name="a_duration" placeholder="e.g. 30"/></p>
		<p><input type="submit" name="submit" class="span5 btn btn-primary green" value="Add appointment type"/></p>
	</form>     
	</div>
</div>

<div class="span8">
<?php if(isset($_GET['add']) && $_GET['add']=="success"){ ?>
<div class="alert alert-success">Appointment Type Added Successfully.</div>
<?php } ?>

<?php if(isset($_GET['del']) && $_GET['del']=="success"){ ?>
<div class="alert alert-success">Appointment Type Deleted Successfully.</div>
<?php } ?>
<div class="well">
	<div class="well-header">
	<h5><strong>Appointment Types</strong></h5>	
	</div>
	<div class="well-content">
		<table class="table table-bordered">
			<tr><th>Type Name</th><th>Price</th><th>Duration</th><th>Action</th></tr>
		<?php 
		$qry22=mysql_query("SELECT * FROM appointment_types WHERE user_id = '".$_SESSION['USER_ID']."'");
		while($row22=mysql_fetch_array($qry22)){
		?>
			<tr><td><?php echo $row22['name']; ?></td><td><?php echo $row22['price']; ?></td><td><?php echo $row22['duration']; ?> Minutes</td><td><a href="execute/del_a_type.php?id=<?php echo $row22['id']; ?>"><i class="icon-remove"></i></a></td></tr>
		<?php } ?>
		</table>
	</div>
</div>
</div>
</div>
</div>

</div>
<?php include "footer.php"; ?>